package com.example.websocket.pattern.structural.adapter;

public class AudioPlayer implements MediaPlayer {

    private MediaAdapter mediaAdapter;

    @Override
    public void play(String playType, String fileName) {
        if (playType.equalsIgnoreCase("mp3")){
            System.out.println(fileName + " media play. mp3 is start play......");
        } else if (playType.equalsIgnoreCase("vlc")){
            System.out.print(fileName + " media play. ");
            mediaAdapter = new MediaAdapter(playType);
            mediaAdapter.play(playType, fileName);
        } else if (playType.equalsIgnoreCase("mp4")){
            System.out.print(fileName + " media play. ");
            mediaAdapter = new MediaAdapter(playType);
            mediaAdapter.play(playType, fileName);
        } else {
            System.out.println("Invalid media. " + playType + " format not supported......");
        }
    }
}
